import React, { useState } from 'react';
import styles from './index.less';
import CustomTabs from './CustomTabs';

const App = () => {
  // 当前tab
  const [activeTabKey, setActiveTabKey] = useState('1');

  //切换tab的回调
  const handleTabChange = key => {
    console.log(key, 'key');
    setActiveTabKey(key);
  };

  // tab列表的数据
  const tabPaneList = [
    {
      tab: '参数配置',
      key: 1,
    },
    {
      tab: '生产概览',
      key: 2,
    },

    {
      tab: '数据全揽表',
      key: 3,
    },
    {
      tab: '财务概览',
      key: 4,
    },
    {
      tab: '变更日志',
      key: 5,
    },
  ];

  return (
    <CustomTabs
      activeTabKey={activeTabKey}
      onChange={handleTabChange}
      TabPaneList={tabPaneList}
    />
  );
};

export default App;
